package cn.itsource.controller.app;

import cn.itsource.pojo.dto.WechatLoginResult;
import cn.itsource.pojo.vo.LoginVo;
import cn.itsource.result.R;
import cn.itsource.service.ILoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * 📖：beishan
 * 🗓️：2024/3/31 14:56
 * =====================
 */
@RestController
@RequestMapping("/app/login")
public class MpLoginController {
    @Autowired
    private ILoginService loginService;


    @PostMapping("/wechat")
    public R wechatLogin(@RequestBody @Valid WechatLoginResult loginResult) {
        LoginVo loginVo = loginService.wechatLogin(loginResult);

        return R.success(loginVo);
    }

}
